<?php
declare (strict_types = 1);

namespace app\api\controller\yuql;

use app\logic\yuql\LoginLogic;
use think\Request;

class Login
{

    public function login(Request $request){
//        echo lock_url(123456);
//        echo unlock_url('JKPHv7ATy123456');
//        dd($request);


        try {
//            $phone = $request->post('phone');
//            $password = $request->post('password');
            if ($request->isPost() != true) return writeJson(20000,'','请求方式不正确',200);

            $params = $request->post('data');

            $res = LoginLogic::logins($params);

            if (!$res) throw new \Exception('请联系技术人员');
            return writeJson(20000,$res,'登录成功',200);
        }catch (\Exception $e){
            return writeJson(20001,'',$e->getMessage(),200);
        }
    }

}
